package DMDE.model.tests;

import java.util.List;
import java.util.UUID;

import main.java.DMDE.model.Entity;
import main.java.DMDE.model.Method;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class ClassTestCase {

	private static final String TEST_CLASS_NAME = "TestClass";
	private static final UUID TEST_UUID = UUID.randomUUID();
	private static final String TEST_METHOD_NAME = "TestMethod";
	private Entity testClass;

	@Before
	public void setUp() {
		testClass = new main.java.DMDE.model.Class(TEST_CLASS_NAME, TEST_UUID);
	}

	@Test
	public void testAddMethod() {
		Method method = new Method(TEST_METHOD_NAME);
		testClass.addMethod(method);
		List<Method> returnMethod = testClass
				.getMethodsByName(method.getName());
		Assert.assertTrue(returnMethod.size() == 1);
		Assert.assertNotNull(returnMethod.get(0));
		Assert.assertEquals(method.getName(), returnMethod.get(0).getName());
	}
}
